import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
import 'package:opnvpn_flutter/opnvpn_flutter.dart';

import 'opnvpn_flutter_platform_interface.dart';

/// An implementation of [OpnvpnFlutterPlatform] that uses method channels.
class MethodChannelOpnvpnFlutter extends OpnvpnFlutterPlatform {
  /// The method channel used to interact with the native platform.
  @visibleForTesting
  final methodChannel =
      const MethodChannel('id.laskarmedia.openvpn_flutter/vpncontrol');

  @override
  Future<String?> getPlatformVersion() async {
    final version = await methodChannel.invokeMethod<String>('status');
    return version;
  }

  @override
  Future<VpnStatus?> status() async {
    final status = await methodChannel.invokeMethod<VpnStatus>('status');
    return status;
  }
}
